import request from "@/utils/request";



// 资质详情
export function productApiCertDetail(productId) {
  return request({
    url: `/backAdmin/productApi/cert/detail?productId=${productId}`,
    method: "get",
  });
}


// 库存详情列表
export function productApiProductStockList(productId) {
  return request({
    url: `/backAdmin/productApi/product/stock/list?productId=${productId}`,
    method: "get",
  });
}


// 品类下拉列表
export function categoryListSelect() {
  return request({
    url: `/backAdmin/productApi/category/list/select`,
    method: "get",
  });
}

// 商品列表 上架
export function listProduct(query) {
  return request({
    url: "/backAdmin/productApi/product/list",
    method: "get",
    params: query,
  });
}
// 商品新增
export function productAdd(data) {
  return request({
    url: `/backAdmin/productApi/product/add`,
    method: "post",
    data,
  });
}
// 商品修改
export function productUpdate(data) {
  return request({
    url: `/backAdmin/productApi/product/update`,
    method: "post",
    data,
  });
}
// 商品删除
export function productDelete(productIdList) {
  return request({
    url: `/backAdmin/productApi/product/delete?productIdList=${productIdList}`,
    method: "post",
  });
}
// 商品详情
export function productDetail(productId) {
  return request({
    url: `/backAdmin/productApi/product/detail?productId=${productId}`,
    method: "get",
  });
}

// 分类新增
export function typeAdd(data) {
  return request({
    url: `/backAdmin/productApi/type/add`,
    method: "post",
    data,
  });
}
// 分类修改
export function typeUpdate(data) {
  return request({
    url: `/backAdmin/productApi/type/update`,
    method: "post",
    data,
  });
}
// 分类删除
export function typeDelete(productCategoryTypeIdList) {
  return request({
    url: `/backAdmin/productApi/type/delete?productCategoryTypeIdList=${productCategoryTypeIdList}`,
    method: "post",
  });
}
// 分类详情
export function typeDetail(productCategoryTypeId) {
  return request({
    url: `/backAdmin/productApi/type/detail?productCategoryTypeId=${productCategoryTypeId}`,
    method: "get",
  });
}

// 添加品类
export function categoryAdd(data) {
  return request({
    url: `/backAdmin/productApi/category/add`,
    method: "post",
    data,
  });
}
// 添加品类详情
export function categoryAddInfo() {
  return request({
    url: `/backAdmin/productApi/category/add/info`,
    method: "get",
  });
}
// 品类修改
export function categoryUpdate(data) {
  return request({
    url: `/backAdmin/productApi/category/update`,
    method: "post",
    data,
  });
}
// 品类删除
export function categoryDelete(productCategoryIdList) {
  return request({
    url: `/backAdmin/productApi/category/delete?productCategoryIdList=${productCategoryIdList}`,
    method: "post",
  });
}
// 品类详情
export function categoryDetail(productCategoryId) {
  return request({
    url: `/backAdmin/productApi/category/detail?productCategoryId=${productCategoryId}`,
    method: "get",
  });
}

// 品类列表
export function listCategory(query) {
  return request({
    url: "/backAdmin/productApi/category/list",
    method: "get",
    params: query,
  });
}

// 分类列表
export function listType(query) {
  return request({
    url: "/backAdmin/productApi/type/list",
    method: "get",
    params: query,
  });
}



// 质保管理列表
export function listGuarantee(query) {
  return request({
    url: "/backAdmin/productApi/guarantee/list",
    method: "get",
    params: query,
  });
}

// 商品 - 资质详情
export function spproductApiCertDetail(productId) {
  return request({
    url: `/backAdmin/productApi/cert/detail?productId=${productId}`,
    method: "get",
  });
}

// 商品- 资质管理列表
export function listCert(query) {
  return request({
    url: "/backAdmin/productApi/cert/list",
    method: "get",
    params: query,
  });
}
// 临期管理列表
export function listExpire(query) {
  return request({
    url: "/backAdmin/productApi/expire/list",
    method: "get",
    params: query,
  });
}






// 价格管理列表详情
export function productApiPriceDetail(productId) {
  return request({
    url: `/backAdmin/productApi/price/detail?productId=${productId}`,
    method: "get",
  });
}

// 价格管理列表
export function listPrice(query) {
  return request({
    url: "/backAdmin/productApi/price/list",
    method: "get",
    params: query,
  });
}



// 库存管理列表
export function listStorage(query) {
  return request({
    url: "/backAdmin/productApi/storage/list",
    method: "get",
    params: query,
  });
}
// 查询公告详细
export function getNotice(noticeId) {
  return request({
    url: "/system/notice/" + noticeId,
    method: "get",
  });
}

// 新增公告
export function addNotice(data) {
  return request({
    url: "/system/notice",
    method: "post",
    data: data,
  });
}

// 修改公告
export function updateNotice(data) {
  return request({
    url: "/system/notice",
    method: "put",
    data: data,
  });
}

// 删除公告
export function delNotice(noticeId) {
  return request({
    url: "/system/notice/" + noticeId,
    method: "delete",
  });
}
